//
//  DFAppleTableViewCell.m
//  DFMessage
//
//  Created by lanou on 15/10/26.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "DFAppleTableViewCell.h"
#import "Header.pch"
#import "UIImageView+WebCache.h"
#import "DFSignlTon.h"

@implementation DFAppleTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        CGFloat lx = kScreenWidth/4;
        _imgsrcImage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 8, lx,lx*3/4)];
        [self.contentView addSubview:_imgsrcImage];
        
        _stitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(lx + 10, 5, lx * 3 - 16, 45)] ;
        _stitleLabel.font = [UIFont systemFontOfSize:15];
        _stitleLabel.numberOfLines = 0;
        [self.contentView addSubview:_stitleLabel];
        
        _sdateLabel = [[UILabel alloc]initWithFrame:CGRectMake(lx + 10,53, lx + 20, 15)];
        _sdateLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_sdateLabel];
        
        _comment_numLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 45, 53,40 , 15)];
        _comment_numLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_comment_numLabel];
        
        UIImageView *aimage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 65, 53, 15, 15)];
        aimage.image = [UIImage imageNamed:@"a"];
        [self.contentView addSubview:aimage];
        
//        UILabel *sline = [[UILabel alloc] initWithFrame:CGRectMake(0, 90, kScreenWidth, 2)];
//        sline.backgroundColor = [UIColor lightGrayColor];
//        [self.contentView addSubview:sline];
        
    }
    return self;
}


-(void)setConfigureModel:(DFappleModel *)configureModel{
    _configureModel = configureModel;
    DFSignlTon *signlTon = [DFSignlTon shareInstance];
    if (signlTon.savemode == SaveModeYes)
    {
        _imgsrcImage.image = [UIImage imageNamed:@""];
    }else
    {
        [_imgsrcImage sd_setImageWithURL:[NSURL URLWithString:configureModel.imgsrc]];
    }

    _stitleLabel.text = configureModel.stitle;
    NSString *str = configureModel.sdate;
    _sdateLabel.text  = [str substringToIndex:10];
    _comment_numLabel.text = [NSString stringWithFormat:@"%@",configureModel.comment_num];
    _joinPeopleLabel.text  = [NSString stringWithFormat:@"%@",configureModel.joinPeople];
    
    
}







@end
